package com.dyh.quickdemo.demos.beanReplace;

import com.alibaba.fastjson.JSON;
import org.junit.jupiter.api.Test;
import org.springframework.util.Assert;

/*
@Author=Joey Wheeler
@Date=2021/1/7 13:52
*/
public class BuilJs {



    @Test
    public void test(){
//        Assert.isTrue(
//
//                        6900+
//                                +600
//                                -3450
//                        == 4050
//        );

        Assert.isTrue(
                2100+900
                -2000 == 1000
        );

    }

    @Test
    public void testA(){
        Assert.isTrue(1==2,"错误");
    }

    @Test
    public void test2(){
        int allPrice =
                3900*2 +83800;

        int  allDiscount =
                3900+41900;

        //Assert.isTrue(45800==allDiscount-allPrice);

        System.out.println();
    }


    @Test//pass
    public void test0(){
        int allPrice =
                15800*3 +17800*2+2100;

        int  allDiscount =
                24228+18197+1075;


        System.out.println();

                /*41600*/
    }

    @Test//pass
    public void test1(){
        int allPrice =
                2100+10900;
//        int  allDiscount =
//                323+1677
//                        + 5000;


        int  allDiscount =
                1130+5870;

        System.out.println();

//        System.out.println(
//                15800*3 + 17800*2 + 2100
//                + 40000
//        );
//
//        System.out.println(
//                1949+1464+87+40000
//        );
    }


    public static void main(String[] args) {
        String codeSrc = "package com.dyh.quickdemo.demos.beanReplace;\n" +
                "\n" +
                "import org.slf4j.Logger;\n" +
                "import org.slf4j.LoggerFactory;\n" +
                "import org.springframework.beans.factory.annotation.Autowired;\n" +
                "import org.springframework.stereotype.Service;\n" +
                "\n" +
                "/*\n" +
                "@Author=Joey Wheeler\n" +
                "@Date=2021/1/7 13:09\n" +
                "*/\n" +
                "\n" +
                "public class ServiceA implements ItfServiceA{\n" +
                "\n" +
                "    @Autowired\n" +
                "    CommonDao commonDao;\n" +
                "\n" +
                "    Logger logger = LoggerFactory.getLogger(this.getClass());\n" +
                "\n" +
                "    public String a(){\n" +
                "\n" +
                "        return \"A1111.a()\"+commonDao.common();\n" +
                "    }\n" +
                "}\n";

        BeanReplaceBiz.ReplaceContext context = new BeanReplaceBiz.ReplaceContext();
        context.setBeanName("serviceA");
        context.setCodeSrc(codeSrc);

        System.out.println(JSON.toJSONString(context));
    }
}
